<%!@SuppressWarnings("unchecked")%>
<%@ page import="com.pension.servlet.calendar.Calendars"%>
<%@ page import="java.util.*" %>

<%@ page import="com.pension.model.dao.MemberDao"%>
<%@ page import="com.pension.model.dao.ReservationDao"%>
<%@ page import="com.pension.model.dto.Member"%>
<%@ page import="com.pension.model.dto.Reservation"%>

<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    
<%
		System.out.println("in a control jsp..");

		//단독 접근은 차단됨.. 구현 요망

		// 설정값 로드
		boolean adminMod = (Boolean)request.getAttribute(Calendars.ADMINMOD);
		ArrayList<Integer> roomsarray = (ArrayList<Integer>)request.getAttribute(Calendars.ROOMSLIST);
		String remoteid = (String)request.getAttribute(Calendars.REMOTE_ID);
		
		System.out.println("들어온 변수 : " + adminMod + " " + roomsarray.toString() + " " + remoteid);
		
		// DB 커넥트 및 로그인 섹션 가져오기
		MemberDao memberDao = new MemberDao();
		ReservationDao reservationDao = new ReservationDao();
		Member loginuser = (Member)request.getSession().getAttribute("loginuser");
	
		// 관리자 모드 권한 체크
		if ( adminMod == Calendars.YES )
		{
			if ( loginuser != null )
			{
				if ( loginuser.getUserType() != "admin" )
				{
					this.destroy();
					return;
				}
				else
				{
					// 관리자 모드 허용
				}
			}
			else
			{
				this.destroy();
				return;
			}
		}
%>

<head>
<style type="text/css">
	.inp{
		border:1 solid #E2EAFF;
		font-family:"굴림체";
		font-size:10pt;
	}
	a, a:link, a:visited, a:active{
		text-decoration: none;
		color: #122293;
	}
	a:hover{
		text-decoration: none;
		font-size: 10pt
	}
</style>
</head>

